package com.example.iotmanagerment26.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 作者：太难猫
 * 创建时间： 2025/6/4 18:02
 */
@Component
public class ActObj {
    // 隐藏swagger-ui字段
    @JsonIgnore
    String actid;
    @Schema(defaultValue = "b8:27:eb:a3:e6:dc")
    String devid;
    @JsonIgnore
    String devname;
    @Schema(defaultValue = "rpi")
    String types;
    @JsonIgnore
    String subdevid;
    @Schema(defaultValue = "1")
    String unit;
    @Schema(defaultValue = "1")
    String act;
    @Schema(defaultValue = "-")
    String content;
    @JsonIgnore
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date sendtime;
    @JsonIgnore
    String username;

    public ActObj() {
    }

    public ActObj(String actid, String devid, String devname, String types, String subdevid, String unit, String act, String content, Date sendtime, String username) {
        this.actid = actid;
        this.devid = devid;
        this.devname = devname;
        this.types = types;
        this.subdevid = subdevid;
        this.unit = unit;
        this.act = act;
        this.content = content;
        this.sendtime = sendtime;
        this.username = username;
    }

    public String getActid() {
        return actid;
    }

    public void setActid(String actid) {
        this.actid = actid;
    }

    public String getDevid() {
        return devid;
    }

    public void setDevid(String devid) {
        this.devid = devid;
    }

    public String getDevname() {
        return devname;
    }

    public void setDevname(String devname) {
        this.devname = devname;
    }

    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public String getSubdevid() {
        return subdevid;
    }

    public void setSubdevid(String subdevid) {
        this.subdevid = subdevid;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getAct() {
        return act;
    }

    public void setAct(String act) {
        this.act = act;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getSendtime() {
        return sendtime;
    }

    public void setSendtime(Date sendtime) {
        this.sendtime = sendtime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    public String toString() {
        return "ActObj{" +
                "actid='" + actid + '\'' +
                ", devid='" + devid + '\'' +
                ", devname='" + devname + '\'' +
                ", types='" + types + '\'' +
                ", subdevid='" + subdevid + '\'' +
                ", unit='" + unit + '\'' +
                ", act='" + act + '\'' +
                ", content='" + content + '\'' +
                ", sendtime=" + sendtime +
                ", username='" + username + '\'' +
                '}';
    }
}